package com.sxhuayuan.parking.service.impl.pojo;

import com.alibaba.fastjson.annotation.JSONField;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 正在出场的车辆信息
 * 
 * @author gy
 */
@Setter
@Getter
@NoArgsConstructor
public class ExitingCar {

	// 车场编号
	private String lotSn;
	// 车道id
	private Long exitid;
	// 设备号
	private String device;
	// 车牌号
	private String carPlate;
	// 应缴费用 (总-减免)
	private Float fee;
	// 减免金额
	private Float discountFee;
	// 入场时间
	private String inTime;
	// 出场时间
	private String outTime;
	// 停车分钟数
	private Integer parkMinutes;
	// 第三方流水号
	private String lotOrderNo;
	// 车厂入场编号
	private String lotRecordId;

	private Long uniqueId;
	// 本数据保存的时间
	private Long saveTime = 0L;

	/** 是否过期 */
	@JSONField(serialize = false)
	public boolean isExpired() {
		return System.currentTimeMillis() - this.getSaveTime() > 5 * 60 * 1000;
	}

	public ExitingCar(String lotSn, Long exitid, String device, String carPlate, Float fee, Float discountFee, String inTime, String outTime, Integer parkMinutes, String lotOrderNo,
			String lotRecordId, Long uniqueId) {
		super();
		this.lotSn = lotSn;
		this.exitid = exitid;
		this.device = device;
		this.carPlate = carPlate;
		this.fee = fee;
		this.discountFee = discountFee;
		this.inTime = inTime;
		this.outTime = outTime;
		this.parkMinutes = parkMinutes;
		this.lotOrderNo = lotOrderNo;
		this.lotRecordId = lotRecordId;
		this.uniqueId = uniqueId;
		this.saveTime = System.currentTimeMillis();
	}

}
